/**
 * DFS，先从一边的DFS来遍历
 * @param root
 * @returns {[]|*}
 */
function tree(root){
    if(!root) return root
    let res = []
    DFS(root, 0, res)
    function DFS(root, step, res) {
        if(root) {
            if(!res[step]) res[step] = []
            res[step] = root.val
            DFS(root.left, step+1,res)
            DFS(root.right, step+1, res)
        }
    }
    return res;
}




